<?php

namespace SunAdmin\Exception;

use SunAdmin\Common\ResponseJson;
use think\exception\Handle;
use think\Response;
use Throwable;

class ExceptionHandle extends Handle
{
    public function render($request, Throwable $e): Response
    {
        // 添加自定义异常处理机制
        if(1){
            return ResponseJson::error($e->getMessage(),500,$e->getTrace());
        }
        // 其他错误交给系统处理
        return parent::render($request, $e);
    }
}